﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.ServiceModel.DomainServices.Server;

namespace Candy.Web.Data
{

    public class ProjectDto
    {
        [Key]
        [Display(AutoGenerateField = true)]
        public int Id { get; set; }

        [StringLength(50, MinimumLength = 3, ErrorMessage = "A project name should be at least 3 characters long but not longer than 50 character.")]
        [RegularExpression(@"^[0-9A-Za-z]{3,50}$", ErrorMessage = "Name should only contain characters and numbers.")]
        [Required]
        [Display(Order = 1)]
        public string Name { get; set; }

        [Display(Order = 2)]
        public string Description { get; set; }

        [Required]
        public bool IsPublic { get; set; }

        [Display(AutoGenerateField = true)]
        public string Owner { get; set; }

        [Include]
        [Association("FishingDatabase_Rows", "Id", "ProjectId")]
        public List<DatabaseDto> FishingDbs { get; set; }


        public bool AllowImportAll { get; set; }
    }
}